<template>
  <div class="gray-page resident-detail-page">
    <nav-bar :title="title"></nav-bar>
    <div class="resident-detail-main page-main">
      <van-sticky class="page-scroll" :offset-top="44">
        <!-- 1：更新  2：审核  3：采集 -->
        <p class="resident-detail-time" v-if="formParams.addTime">
          <template v-if="$route.query.queryType === '1'">上次更新时间：</template>
          <template v-if="$route.query.queryType === '2'">上次审核时间：</template>
          <template v-if="$route.query.queryType === '3'">上次采集时间：</template>
          {{ formParams.addTime }}
        </p>
        <van-form input-align="right" :label-width="120">
          <van-field
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.organizationTypeName"
            label="组织类型"
          />
          <van-field
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.licenseNum"
            label="统一社会信用代码"
          />
          <van-field
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.organizationCategoryName"
            :label="formParams.organizationType === '1' ? '企业类别' : '社会组织类别'"
          />
          <van-field
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.organizationName"
            :label="formParams.organizationType === '1' ? '企业名称' : '社会组织名称'"
          />
          <van-field
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.organizationAddress"
            :label="formParams.organizationType === '1' ? '企业地址' : '住所'"
          />
          <van-field
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.latitudeLongitude"
            label="经纬度"
          />
          <van-field
            v-if="formParams.organizationType === '1'"
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.organizationPhone"
            label="企业联系方式"
          />
          <van-field
            v-if="formParams.organizationType === '2'"
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.registrationNo"
            label="登记证号"
          />
          <van-field
            v-if="formParams.organizationType === '1'"
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.organizationPersonNum"
            label="企业员工数"
          />
          <van-field
            v-if="formParams.organizationType === '2'"
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.registrationAuthority"
            label="登记管理机关"
          />
          <van-field
            v-if="formParams.organizationType === '1'"
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.legalIdTypeName"
            label="法定代表人证件类型"
          />
          <van-field
            v-if="formParams.organizationType === '1'"
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.legalIdCard"
            label="法定代表人证件号码"
          />
          <van-field
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.legalPersonName"
            label="法定代表人姓名"
          />
          <van-field
            v-if="formParams.organizationType === '1'"
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.legalPhone"
            label="法定代表人联系方式"
          />
          <van-field
            v-if="formParams.organizationType === '2'"
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.officeAddress"
            label="办公地址"
          />
          <van-field
            v-if="formParams.organizationType === '2'"
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.approvalDate"
            label="批准日期"
          />
          <van-field
            v-if="formParams.organizationType === '2'"
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.certificateValidityDate"
            label="证书有效期"
          />
          <van-field
            v-if="formParams.organizationType === '2'"
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.registeredCapital"
            label="注册资金"
          />
          <van-field
            v-if="formParams.organizationType === '2'"
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.organizationStatusName"
            label="状态"
          />
          <van-field
            v-if="formParams.organizationType === '2'"
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.legalIdTypeName"
            label="负责人证件类型"
          />
          <van-field
            v-if="formParams.organizationType === '2'"
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.legalIdCard"
            label="负责人证件号码"
          />
          <van-field
            v-if="formParams.organizationType === '2'"
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.chargePersonName"
            label="负责人姓名"
          />
          <van-field
            v-if="formParams.organizationType === '2'"
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.legalPhone"
            label="负责人联系方式"
          />
          <van-field
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.insurancePersonName"
            label="治保负责人姓名"
          />
          <van-field
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.insurancePersonPhone"
            label="治保负责人联系方式"
          />
          <van-field
            readonly
            label-class="van-cell__title_gray"
            v-model="formParams.dangerousEnterprisesName"
            label="是否危化企业"
          />
          <van-field
            v-if="formParams.organizationType === '1'"
            readonly
            label-class="van-cell__title_gray"
            required
            v-model="formParams.potentialSafetyTypeName"
            label="安全隐患类型"
          />
          <van-field
            readonly
            label-class="van-cell__title_gray"
            v-model="formParams.degreeConcernName"
            label="关注程度"
          />
          <van-field
            readonly
            label-class="van-cell__title_gray"
            v-model="formParams.establishPartyOrganizationName"
            label="是否具备建立中央党组织条件"
          />
          <van-field
            readonly
            label-class="van-cell__title_gray"
            v-model="formParams.havePartyOrganizationName"
            label="是否有中共党组织"
          />
          <van-field
            readonly
            label-class="van-cell__title_gray"
            v-model="formParams.haveUnionName"
            label="是否有工会"
          />
          <van-field readonly label-class="van-cell__title_gray" v-model="formParams.unionNum" label="工会会员数量" />
          <van-field
            readonly
            label-class="van-cell__title_gray"
            v-model="formParams.haveCommunistYouthLeagueName"
            label="是否有共青团组织"
          />
          <van-field
            readonly
            label-class="van-cell__title_gray"
            v-model="formParams.communistYouthNum"
            label="共青团团员数量"
          />
          <van-field
            readonly
            label-class="van-cell__title_gray"
            v-model="formParams.haveFederationWomenName"
            label="是否有妇联组织"
          />
          <van-field readonly label-class="van-cell__title_gray" v-model="formParams.womenNum" label="妇女数量" />
          <van-field readonly label-class="van-cell__title_gray" v-model="formParams.sourceFunds" label="资金来源" />
          <van-field
            readonly
            label-class="van-cell__title_gray"
            v-model="formParams.overseasBackgroundName"
            label="是否有境外背景"
          />
          <div style="padding: 16px"></div>
        </van-form>
      </van-sticky>
    </div>
  </div>
</template>

<script>
import Resident from '@/api/resident'
export default {
  data() {
    return {
      title: '组织基础信息采集',
      formParams: {}
    }
  },
  created() {
    console.log(this.$route.query)
    this.getDetail()
  },
  methods: {
    getDetail() {
      Resident.BaseInfo.organizationDetail({
        organizationCode: this.$route.query.organizationCode,
        organizationType: this.$route.query.organizationType
      }).then(res => {
        const { status, data } = res.data
        if (status === 0) {
          this.formParams = { ...data }
        }
      })
    }
  }
}
</script>
<style lang="less" scoped>
@import '~@/assets/style/resident/detail.less';
</style>
